Intellivision Music and Sound Demo Test v1.0
--------------------------------------------
I don't think my music and sound engine is very different from Arnauld
Chevallier's, but there are some things that are organized differently. First
of all, I designed it from the beginning with the idea that sound effects and
music would be handled exactly the same way. I wanted it to be as flexible as
possible, so I came up the with the idea of having a separate tone and volume
stream for each channel. This means that for each sound that is playing, the
tone and volume aspects of the sound are being interpreted separately. This
allows you, for example, to have the tone portion doing its own thing, and have
the volume operate independently of that. In my SNDTEST program (attached), the
tone stream is the first row of numbers in any given channel, and the volume is
the second. The third row is actually for the noise, but it can be used in
different ways. I'll explain that later.

Each stream has the following features: a VELOcity field (second column), which
is added to the VALUe field (first column) each tick. There's also an EFfect
number (last column), which points to (through an intermediate table)
pre-computed effect data, which is applied to that aspect of sound (either
volume or tone) by temporarily adding a new offset to the VALUe each tick
before going out to the sound hardware. The effects data code also allows for
jumping, so it's possible to loop, reset, or sustain an effect. Each stream
also has the ability to repeat blocks of code (commands which are interpreted
on that stream), nested up to eight levels deep (in practice, it will likely be
fewer than that, since how deep you can nest depends on how many bits you need
to represent repeat values). The WAit field is used to pause the command
interpreter on that stream for a given amount of the ticks (up to 64 at a time,
but you can chain waits together). The lower two bits of this field are used to
indicate the interpreter's mode. There is a special mode for music, which
allows you to conserve space. It is similar to Arnauld's format, but it allows
you to bump the effect number up by one (temporarily) without specifying
another word. If you want to actually change the effect number, though, you
have to break out of music mode and issue a SetEffNum command. Each stream can
also call phrases, which means that it has the ability to call a subroutine,
although they cannot be nested (due to memory restrictions, I did not implement
the separate stack for each stream which would be necessary to nest calls). You
can use them like patterns if you want, to repeat a block of music somewhere
else in the song.

The noise is controlled by the tone stream. You can either have the noise
modified separately (in this case, the third row shows separate noise VALUe and
VELOcity fields), or you can control it with the tone's VALUe and VELOcity,
which also allows you to apply an effect the noise, as you would a tone. If you
want to use the call phrase feature, you must use it this way, as the noise
VALUe and VELOcity fields are then used to hold return tokens for the tone and
volume streams.

Note that there are also commands which allow you to set the VALUe, VELOcity,
REpeat count, WAit, etc. randomly. There are several sound effects included
which demonstrate this.

The most interesting thing (in my opinion) about the engine is the way in which
sounds priorities are handled. Basically, lower prioritized sounds fall to the
ECS, and higher prioritized sounds to the INTV. The effect is this: if the ECS
is not plugged in, sound effects appear to interrupt the music temporarily, and
then resume the music--as if it had been playing all along--when the sound
effect finishes. If the ECS is plugged in, they play simultaneously. This means
that you can design your sounds and music to use only the Master Component.
However if the user plugs in the ECS, he will automatically enjoy better sound,
since there will be fewer interrupted sound effects and continuous music.

Also, only one channel per PSG has the ability to modify the noise. If there's
more than one sound trying to control the noise, the sound with the highest
priority gets it. If the tone stream enables and disables its use of the noise
(for example, between drumbeats), it allows other sounds trying to control the
noise a chance to be heard (in between beats).

That's about it. The are some other features, but this, along with playing with
the sound test demo yourself, should give you a good idea of how the sound
engine functions.

Finally, here are some quick instructions on how to control my sound demo:

MUSIC & SOUND DEMO TEST

OK, here's some quick instructions for my music and sound demo/test.

First of all, you need to press Enter to get past the title screen. You really
should press Enter, and not some other key, or you're going to get really
confused.

Press the Disc up or down to navigate the menu. Note that you can do this even
when not on the menu screen, allowing you to select songs, sound effects, the
speed, or the volume level even when you're not on the menu screen.

Press left or right when the sound or music row is highlighted to change the
music or sound list number. Note that there is only one sound list in this
demo, so you won't be able to move beyond #0. There are however five different
music lists numbered 0-4.

Press 1 through 9 to select a song, sound effect, speed, or volume level,
depending on which menu row you have highlighted.

Press 0 to fade out and halt the currently playing music.

Press Clear to go the the previous screen and press Enter to go to the next
screen.

Press the Upper button to play the last sound effect selected. This allows you
to play a sound effect even when you do not have sound effects selected on the
menu screen.

Press the Lower Left button to select the music row. This is equivalent to
moving the menu selection bar to the music row with the disc.

Press the Lower Right button to select the sound row. This is equivalent to
moving the menu selection bar to the sound row with the disc.

There are five different screens available (6 if you count the title), and are,
in order: the menu, the ECS sound records dump screen, INTV sound records dump
screen, the ECS/INTV PSG dump screen, and a blank screen.

There are five different sound lists, each list corresponding to the game from
which the songs were taken and are, in order (and with the number of songs
included):

0 - Zillion (4)
1 - Phantasy Star (9)
2 - Space Harrier (9)
3 - Alex Kidd (5)
4 - Ghostbusters (1)

That's 28 songs in all, many of which are quite long.

Please note that this program should be run with an ECS unit plugged in. It
will sound all right without one, but the music will have an extra channel, and
the sound effects will be interrupted less frequently if you run the program
with the ECS unit plugged in.


Carl Mueller, Jr.
December 1, 2003
